//
//  StatusForwardCell.swift
//  CLWeiBo
//
//  Created by 程雷 on 15/7/2.
//  Copyright © 2015年 程雷. All rights reserved.
//

import UIKit
import FFAutoLayout

class StatusForwardCell: StatusCell {

    override init(style:UITableViewCellStyle,reuseIdentifier:String?){
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        
        // 初始化微博标签
        forwardLabel = UILabel(color: UIColor.darkGrayColor(), fontSize: 14, mutilines: true)
        forwardLabel!.preferredMaxLayoutWidth = UIScreen.mainScreen().bounds.width - 16
        //把微博标签插在最下层
        insertSubview(forwardLabel!, atIndex: 0)
        forwardLabel?.backgroundColor = UIColor(white: 0.9, alpha: 1.0)
        insertSubview(forwardButton, atIndex: 0)
        
        //自动布局，按钮背景
        forwardButton.ff_AlignVertical(ff_AlignType.BottomLeft, referView: contentLabel, size: nil, offset: CGPoint(x: -12, y: 12))
        // TODO:footerView
       // forwardButton.ff_AlignVertical(ff_AlignType.TopRight, referView: footerView, size: nil)
        //转发文字
        forwardLabel!.ff_AlignInner(ff_AlignType.TopLeft, referView: forwardButton, size: nil, offset: CGPoint(x: 12, y: 12))
        
        // 配图视图
        let cons = pictureView.ff_AlignVertical(ff_AlignType.BottomLeft, referView: forwardLabel!, size: CGSize(width: 290, height: 90), offset: CGPoint(x: 0, y: 12))
        //纪录宽高约束
        recordPictureViewCons(cons)
        
    }

    required init(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
 
    //MARK --- 懒加载加载空间
    lazy var forwardButton = UIButton()
}
